<!DOCTYPE html>
<html lang="en"
	  xmlns:th="http://www.thymeleaf.org"
	  xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">

	<head>
		<meta charset="UTF-8">
		<title th:text="${data.title}"></title>
		<style>
			#iframe,#handout_wrap_inner{width: 50vw;height: 48vw;}
		</style>
	</head>
	<body>	
			<!--pdf在线预览,需要调用下面js方法-->
<!--           	<div id="handout_wrap_inner"></div>	 -->
           	
           	<!--word文档在线预览 http://www.xdocin.com/xdoc?_func=to&_format=html&_cache=true&_xdoc=你的文档地址-->
           	<iframe src="" id="iframe"></iframe>
	</body>

<script src="../../dist/js/jquery-3.1.0.js"></script>
<script src="../../dist/js/jquery.media.js"></script>
<script th:inline="javascript">
	$(function () {
		var url = "http://www.xdocin.com/xdoc?_func=to&amp;_format=html&amp;_cache=1&amp;_xdoc="
		const urlplush = /*[[${data.filePath}]]*/{};
		const base = /*[[${#httpServletRequest.getScheme() + '://' + #httpServletRequest.getServerName() + ':' + #request.getServerPort()+'/'}]]*/{};
		console.log(url + base + urlplush)
		$("#iframe").attr("src",url + base + urlplush);

		// 	$('#handout_wrap_inner').media({
// //      width: '100%',
// //      height: '100%',
//         autoplay: true,
//         src:'ceshi.pdf',
//    });
	})

</script>
</html>